package com.woniu.sharepark.config;

import com.woniu.sharepark.leasesystem.common.constant.SystemConstant;
import com.woniu.sharepark.platformsystem.dao.ScaleDAO;
import com.woniu.sharepark.platformsystem.pojo.Scale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author DELL
 * @date 2019/6/20 19:40
 * version v1.0
 */
@Component
public class ScaleConfig  implements CommandLineRunner {

    @Autowired
    private ScaleDAO scaleDAO;

    @Override
    public void run(String... args) throws Exception {
        Scale scale = scaleDAO.findScale();
        SystemConstant.scale = scale;

    }
}
